<?php
class Mworker extends CH_Controller {
    function __construct(){
        parent::__construct();
        $this->load->model(array('common_model','worker_model','setting_model','contents_model'));
        $this->init();
    }
    
    function workerList(){
    	$url = $this->common_model->get_index_uri(2);
    	$uri_array = segment_explode($this->uri->uri_string());
    	$page = in_array('page', $uri_array) ? urldecode($this->security->xss_clean(url_explode($uri_array, 'page'))) : 1;
    	$id = urldecode($this->security->xss_clean(url_explode($uri_array, 'id')));
    	$param['sch_duty'] = urldecode($this->security->xss_clean(url_explode($uri_array, 'sch_duty')));
    	$param['page'] = $page;
    	$param['listnum'] = 8;
    	
    	$count = $this->worker_model->list_total($param);
    	$result = $this->worker_model->worker_list($param);
    	
    	$list_no = $count - $param['listnum'] * ($page-1);
    	$data = array(
    			'_title' => '작업 진행중입니다.',
    			'_content' => $url,
    			'_skin' => 'sub',
    			'_front' => 'Y',
    			'_menu_id' => $id ,
    			'rst' => $result,
    			'list_no'=> $list_no,
    			'code_duty'=> $this->common_model->select_child_code(2),
    			'param'=>$param
    	);
    	
    	$content = $this->contents_model->select($id);
    	$content = array('_title'=>$content['title'],'_group'=>$content['parent_id']);
    	$data = array_merge($data,$content );
    	
    	return $data;
    	
    }

}
?>